/**
 * 
 */
package homework5;

import java.util.LinkedList;

/**
 * @author Nican
 *
 */
public class Node {
	
	String name;
	LinkedList<Node> neighbors = new LinkedList<Node>();
	
	public Node(String name){
		this.name = name;
	}
	
	/**
	 * Adds a node that can be connected to this node
	 * @param neighbor
	 */
	public void addNeighbor( Node neighbor ){
		neighbors.add(neighbor);
		neighbor.neighbors.add(this);
	}

	public String toString(){
		return "Node (" + this.name + ")";
	}
	
}
